# Contributors: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: team/gnome <pabloyoyoista@postmarketos.org>
pkgname=gnome-calculator
pkgver=47.0
pkgrel=0
pkgdesc="Calculator for solving mathematical equations"
url="https://wiki.gnome.org/Apps/Calculator"
# s390x: doubt anyone would run this on a mainframe
arch="all !s390x"
license="GPL-3.0-or-later"
makedepends="
	glib-dev
	gtksourceview5-dev
	gtk4.0-dev
	itstool
	libadwaita-dev
	libgee-dev
	libsoup3-dev
	libxml2-dev
	meson
	mpc1-dev
	mpfr-dev
	vala
	"
subpackages="$pkgname-devhelp $pkgname-doc $pkgname-lang $pkgname-dev"
source="https://download.gnome.org/sources/gnome-calculator/${pkgver%%.*}/gnome-calculator-$pkgver.tar.xz"

build() {
	abuild-meson \
		-Db_lto=true \
		. output
	meson compile -C output
}

check() {
	# loongarch64, armhf, ppc64le and riscv64 timeouted number test with standard timeout
	meson test -t 10 --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
a746c54ba260f4f0866a4299b659c4d488e99b5ecf25641a88f2c20c5a7da12abcfea5b31c16da42f6acb778a2013f239ed4407fba67f35bb9e9f7721d9d224d  gnome-calculator-47.0.tar.xz
"
